package com.jxj.study.util;

public class ResponseModel<T> {
    private String message;
    private T data;
    private Integer code;

    public ResponseModel(){

    }

    public ResponseModel(String messge){
        this.message = messge;
        this.code = 500;
        this.data = null;
    }

    public ResponseModel(String messge,T t){
        this.message = messge;
        this.code = 200;
        this.data = t;
    }

    public static <T> ResponseModel<T> success(String success) {
        return new ResponseModel<T>(success,null);
    }

    public static <T> ResponseModel<T> fail(String fail) {
        return new ResponseModel<>(fail);
    }
}
